<%-- 
    Document   : form kirim barang
    Created on : Nov 21, 2013, 6:06:25 AM
    Author     : admin
--%>

<%@page import="bean.Pemesanan"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="bean.BarangGudang"%>
<%@page import="bean.Pengiriman"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body bgcolor="856FD7"><br><br>
        <%
            Pengiriman pengiriman = new Pengiriman();
            String kodePengiriman = pengiriman.getKodePengiriman();
        %>
        <form action="KirimBarang">
            <table border="0" align="center" width="600">
                <tr>
                    <td align="center"><img src="image/logo.png" width="380" height="100"></td>
                </tr>
            </table><br>
            <font face="ESP_Bold" size="5px"><center>DATA PEMESANAN</center></font>
            <table border="1" align="center" width="920">
                <tr>
                    <td align="center" bgcolor="689CD2" width="110">KODE PEMESANAN</td>
                    <td align="center" bgcolor="689CD2" width="100">WAKTU PEMESANAN</td>
                    <td align="center" bgcolor="689CD2" width="80">JUMLAH BARANG</td>
                    <td align="center" bgcolor="689CD2" width="80">ID BARANG</td>
                    <td align="center" bgcolor="689CD2" width="110">USERNAME PEMESAN</td>
                    <td align="center" bgcolor="689CD2" width="70">STATUS</td>
                    <td align="center" bgcolor="689CD2" width="110">JUMLAH BARANG TERKIRIM</td>
                    <td align="center" bgcolor="689CD2" width="110">JUMLAH BARANG BELUM TERKIRIM</td>
                </tr>             
                <%
                    Pemesanan pemesanan = new Pemesanan();
                    ResultSet re = pemesanan.tampilPemesanan();
                    while (re.next()) {
                        out.print("<tr><td>" + re.getString("kodepemesanan") + "</td>"
                                + "<td>" + re.getString("waktupemesanan") + "</td>"
                                + "<td>" + re.getString("jumlahbarang") + "</td>"
                                + "<td>" + re.getString("idbarang") + "</td>"
                                + "<td>" + re.getString("username") + "</td>"
                                + "<td>" + re.getString("status") + "</td>"
                                + "<td>" + re.getString("jumlahbarangterkirim") + "</td>"
                                + "<td>" + re.getString("jumlahbarangbelumterkirim") + "</td></tr>");
                    }
                %>
            </table>
            <br>
            <font face="ESP_Bold" size="5px"><center>FORM KIRIM BARANG</center></font>
            <table border="0" align="center" width="310">
                <tr>
                    <td width="56%"><font face="Clarendon Blk BT" size="2px">KODE PENGIRIMAN</font></td>
                    <td><input type="text" size="15" maxlength="8" name="kode_pengiriman" value="<%=kodePengiriman%>" disabled="disabled"></td>
                </tr>
                <tr>
                    <td><font face="Clarendon Blk BT" size="2px">KODE PEMESANAN</font></td>
                    <td><select name="kodepemesanan"><%
                        Pemesanan pemesanan1 = new Pemesanan();
                        ResultSet resultSet = pemesanan1.tampilKodePemesanan();
                        while (resultSet.next()) {
                            out.print("<option value='" + resultSet.getString("kodepemesanan") + "'>" + resultSet.getString("kodepemesanan") + "</option>");
                        }
                            %>
                        </select></td>
                </tr>
                <tr>
                    <td><font face="Clarendon Blk BT" size="2px">JUMLAH BARANG</font></td>
                    <td><input type="text" size="15" maxlength="6" name="jumlahbarang"></td>
                </tr>
                <tr>
                    <td><font face="Clarendon Blk BT" size="2px">HARGA BARANG</font></td>
                    <td><input type="text" size="15" maxlength="6" name="hargabarang"></td>
                </tr>
            </table>
            <br>
            <table border="0" align="center" width="250"> 
                <tr>
                    <td align="center"><a href="form_utama_gudang.jsp"><img src="image/kembali_button.png" width="90" height="25"></a>
                    <td align="center"><input type="image" src="image/simpan_button.png" width="90" height="25" name="simpan"></td>
                </tr>
            </table>
        </form>
    </body>
</html>